﻿package Message.Game
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import Message.Public.*;
    import flash.utils.*;

    public class SRedEnvelopeInfo extends IMessageBase
    {
        public var redId:int;
        public var boss:SMiniPlayer;
        public var bossPosition:int;
        public var redCount:int;
        public var totalMoney:int;
        public var type:int;
        public var guildId:int;
        public var effectDay:Date;
        public var robInfos:Dictionary;
        public const _type:int = 16120;
        public static var _regist:SRedEnvelopeInfo = new SRedEnvelopeInfo(true);

        public function SRedEnvelopeInfo(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SRedEnvelopeInfo();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            param1.writeInt(this.redId);
            this.boss.__write(param1);
            param1.writeInt(this.bossPosition);
            param1.writeInt(this.redCount);
            param1.writeInt(this.totalMoney);
            param1.writeInt(this.type);
            param1.writeInt(this.guildId);
            param1.writeDate(this.effectDay);
            DictRobRedInfosHelper.write(param1, this.robInfos);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.redId = param1.readInt();
            this.boss = new SMiniPlayer();
            this.boss.__read(param1);
            this.bossPosition = param1.readInt();
            this.redCount = param1.readInt();
            this.totalMoney = param1.readInt();
            this.type = param1.readInt();
            this.guildId = param1.readInt();
            this.effectDay = param1.readDate();
            this.robInfos = DictRobRedInfosHelper.read(param1);
            return;
        }// end function

    }
}
